<?php include "htmlBase/header.php"; ?>

<?php
include_once 'Entidades/EntidadeBase.php';
include_once 'Entidades/Saude.php';
$servicoSaude = new Saude();

$id_Responsavel = $_GET["id_Responsavel"];
$Saude = $servicoSaude->ObterPrimeiro("id_Responsavel = $id_Responsavel");

if ($Saude == NULL)
{
    $Saude = new Saude();
    $Saude->id_Responsavel = $id_Responsavel;
}

include_once 'Controles/ComboBox.php'
?>

<div class="page secondary">
    <div class="page-header">
        <div class="page-header-content">
            <h1>Saúde <small>(Cadastro)</small></h1>
             <a href="ResponsavelPainel.php?Id=<?php echo $Saude->id_Responsavel; ?> "class="back-button big page-back"></a>
        </div>
        <div class="progress-bar" align="rigth">
            <div class="bar bg-color-blue" style="width: 75%"></div>
        </div>
    </div>
    <br/>
    <div class="page secondary">
        <div class="page-region">
            <div class="page-region-content">

                <form action="SaudeDados.php" method="POST">

                    <div class="input-control">
                        <input type="hidden" class="with-helper" name="Id" value="<?php echo $Saude->Id; ?>"/>
                        <input type="hidden" class="with-helper" placeholder="id_Responsavel" name="id_Responsavel" value="<?php echo $Saude->id_Responsavel; ?>"/>

                        <div class="grid">
                            <div class="row">
                                <div class="span2">
                                    <div class="input-control text">
                                        <h4>Doente Na Casa</h4>
                                        <?php ComboBox("SimNao", "DoenteNaCasa", $Saude->DoenteNaCasa); ?>
                                    </div>
                                </div>

                                <div class="span8">
                                    <div class="input-control text">
                                        <h4>Tipo da Doença</h4>
                                        <input type="text" class="with-helper" placeholder="Tipo da Doença" name="TipoDoenca" value="<?php echo $Saude->TipoDoenca; ?>" maxlength="100"/>                                    
                                    </div>
                                </div>
                            </div>


                            <div class="row">
                                <div class="span2">
                                    <div class="input-control text">
                                        <h4>Gestante Na Casa</h4>
                                        <?php ComboBox("SimNao", "GestanteNaCasa", $Saude->GestanteNaCasa); ?>
                                    </div>
                                </div>

                                <div class="span3">
                                    <div class="input-control text">
                                        <h4>Gestante Amamentando</h4>
                                        <?php ComboBox("SimNaoBranco", "GestanteAmamentando", $Saude->GestanteAmamentando); ?>
                                    </div>
                                </div>

                                <div class="span2">
                                    <div class="input-control text">
                                        <h4>Mês Gestação</h4>
                                        <?php ComboBox("Numero_9", "MesGestacao", $Saude->MesGestacao); ?>
                                    </div>
                                </div>

                                <div class="span3">
                                    <div class="input-control text">
                                        <h4>Gestante Possui Pré-Natal</h4>
                                        <?php ComboBox("SimNaoBranco", "GestantePossuiPreNatal", $Saude->GestantePossuiPreNatal); ?>
                                    </div>
                                </div>
                            </div>

                            <div class="row">
                                <div class="span3">
                                    <div class="input-control text">
                                        <h4>Deficiente Na Casa</h4>
                                        <?php ComboBox("SimNao", "DeficienteNaCasa", $Saude->DeficienteNaCasa); ?>
                                    </div>
                                </div>

                                <div class="span7">
                                    <div class="input-control text">
                                        <h4>Frequenta Cras</h4>
                                        <?php ComboBox("SimNaoBranco", "DeficienteFrequentaCras", $Saude->DeficienteFrequentaCras); ?>
                                    </div>
                                </div>
                            </div>

                            <div class="row">
                                <div class="span3">
                                    <div class="input-control text">
                                        <h4>Idoso Na Casa</h4>
                                        <?php ComboBox("SimNao", "IdosoNaCasa", $Saude->IdosoNaCasa); ?>
                                    </div>
                                </div>

                                <div class="span3">
                                    <div class="input-control text">
                                        <h4>Frequenta Cras</h4>
                                        <?php ComboBox("SimNaoBranco", "IdosoFrequentaCras", $Saude->IdosoFrequentaCras); ?>
                                    </div>
                                </div>

                                <div class="span4">
                                    <div class="input-control text">
                                        <h4>Vacinação Em Dia</h4>
                                        <?php ComboBox("SimNaoBranco", "VacinacaoEmDia", $Saude->VacinacaoEmDia); ?>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>

                    <br/>

                    <div class="input-control" style="margin-left: auto; margin-right: auto;">
                        <button class="standart default" type="submit">Salvar</button>
                        <?php
                        if ($Saude->Id != 0)
                        {
                            ?>
                            <a href="SaudeCadastro.php?id_Responsavel=<?php echo $Saude->id_Responsavel; ?>" class="button standart">Cancelar</a>
                            <?php
                        }
                        ?>

                        <a href="ResponsavelPainel.php?Id=<?php echo $Saude->id_Responsavel; ?>" class="button standart bg-color-lighten" style="float: right">Voltar</a>
                    </div>

                </form>
            </div>
        </div>
    </div>

</div>

<?php include "htmlBase/footer.php"; ?>
